﻿@{
    Bundle("jquery_timepicker");
    Bundle("jquery_validate");
}

<script type="text/javascript">
    jQuery(document).ready(function(){
        jQuery('@ID("#form")').validate({
            rules: {
                publishedOn: {
                    required: true
                }
            }
        });
        jQuery('@ID("#txt_published")').datetimepicker();
    });
</script>
<form class="common-form" id="@ID("form")" action="@Url.Action(Loc.Act("Update").Localized())" method="post">
    <input type="hidden" name="id" value="@JDM.Int32(Model.EntityID)" />
    <table>
        <tr>
            <td>
                <label>@T(Res.In("Common").Of("Vocab").Name("Date"))</label>
            </td>
            <td>
                <input id="@ID("txt_published")" type="text" name="publishedOn" value="@Svc.DateTime((DateTime)JDM.DateTime(Model.PublishedOn))" />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("PublicationFlags").Name("ReviewAllowed"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="ReviewAllowed" @(JDM.HasFlags(Model.Flags, "ReviewAllowed") ? "checked" : String.Empty) />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("PublicationFlags").Name("AnonReviewAllowed"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="AnonReviewAllowed" @(JDM.HasFlags(Model.Flags, "AnonReviewAllowed") ? "checked" : String.Empty) />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("PublicationFlags").Name("CommentAllowed"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="CommentAllowed" @(JDM.HasFlags(Model.Flags, "CommentAllowed") ? "checked" : String.Empty) />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("PublicationFlags").Name("AnonCommentAllowed"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="AnonCommentAllowed" @(JDM.HasFlags(Model.Flags, "AnonCommentAllowed") ? "checked" : String.Empty) />
            </td>
        </tr>
        <tr>
            <td>
                <label>@T(Res.In("API").Of("Enum").Of("PublicationFlags").Name("Active"))</label>
            </td>
            <td>
                <input type="checkbox" name="flags" value="Active" @(JDM.HasFlags(Model.Flags, "Active") ? "checked" : String.Empty) />
            </td>
        </tr>
    </table>
    <ul class="bar toolbar">
        <li><button class="button" type="submit">@T(Res.In("Common").Of("Act").Name("Submit"))</button></li>
    </ul>
</form>